package com.wuzheng.wisgo.sanitation.cloud.utils;

import com.wuzheng.wisgo.sanitation.cloud.enums.InfixDataEnum;
import com.wuzheng.wisgo.sanitation.framework.util.StringUtils;

/**
 * @author：hoipang
 * @date：Created in 2019-12-27
 * @description：保存方法审核工具
 * @modified By：
 * @version: 1.0
 */
public class MethodUtils {
    /**
     * 方法校验
     *
     * @param method
     * @param primaryId
     * @return
     */
    public static Boolean allowed(String method, String primaryId) {
        Boolean update = method.equals(InfixDataEnum.UPDATE.getTypeId()) && StringUtils.isNotBlank(primaryId);

        Boolean add = method.equals(InfixDataEnum.ADD.getTypeId());

        return (add || update) == true ? true : false;
    }
}
